<?php

require_once('IAuthenticationAdapter.php');
require_once('SecurityException.php');

class MockAuthenticationAdapter implements IAuthenticationAdapter {
	
	public function checkCredentials(ICredentials $credentials) {
		// just return a mock token
		if ($credentials->getUserName() == 'dave') {
			if ($credentials->getPassword() == 'ratmrocks') {
				return md5('decryptthis');
			}		
		} 
		
		throw new SecurityException('The credentials supplied are invalid. Please check your user name and password.');
	}
	
}
